﻿<?php //Seyret Component v.0.3//
/**
* @package Seyret
* @version 0.3
* @copyright Copyright (C) 2008 Mustafa DINDAR. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Seyret Video Component is a free software.
* See seyrettos.html for license notices and details.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );





echo $this->toolbar;
echo $this->modtoolbar;

?>

<div>

	<div class="categoryvideoscattitle">
		<?php echo JText::_('Category');?>: <?php echo $this->categoryname;?>
	
	</div>


	<?php 
	
	if (count($this->subcategorylist) > 0) {
	?>
	<div class="categoryvideossubtitle">
		<?php echo JText::_('Sub Categories');?>
	</div>

	<?php
	
	}
	
	?>

	
	<?php
		foreach ($this->subcategorylist as $category) {
	?>
		<div class="listedvideolistvideomc">
				<div class="backgroundpadding">
					<div class="listedvideolisttitledivmc">
						<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=category&task=videos&id=".$category->id);?>" style="font-weight:bold;">
							<?php echo $category->categoryname;?>
						</a>
					</div>
				</div>
				
				<div class="backgroundpadding">
					<div class="listedvideolistbodymc">
						<div class="listedvideolistthumbdivmc">
							<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=category&task=videos&id=".$category->id);?>">
								<img class="listedvideolistthumbnailmc" src="<?php echo $category->categoryimage;?>" alt=""/> 
							</a>
							
							
						</div>
									
						<div class="clear"></div>

						
					</div>
				</div>
				
				</div>
				

	<?php				


		}	

	?>
	

	<div style="clear:both;"></div>

	<div class="categoryvideossubtitle">
		<?php echo JText::_('Videos');?>
	</div>	
	
	<div>
		<div  style="float:right;">
			<?php
			
				//create switch button here
				if ($this->catvldisplay=="oc") {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=category&task=videos&id=".$this->categoryid."&cvld=multi");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchmulti.png";?>" alt="" />
				</a>
				
				<?php
				
				} else {
				?>
				<a href="<?php echo $this->absURL("index.php?option=com_seyret&view=category&task=videos&id=".$this->categoryid."&cvld=oc");?>">
					<img src="<?php echo JURI::root()."components/com_seyret/themes/default/images/switchoc.png";?>" alt="" />
				</a>
				
				<?php							
				}
			
			?>

		</div>
		<div style="clear:both;"></div>
	</div>


		
	<?php

	//generate one column view
	if ($this->catvldisplay == "oc") {
	
		foreach ($this->videoListInCat as $catvideo) {
		
			$safevideotitle = str_replace("'", "\'", $catvideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($catvideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideooc">
			<div class="listedvideolistinfooc">

				<div class="listedvideolisttitledivoc">
					<a href="<?php echo $catvideo->videolink;?>" style="font-weight:bold;">
						<?php echo $catvideo->videotitle;?>
					</a>
				</div>
				<div class="listedvideolistdescdivoc">
					<?php echo $catvideo->videodescription;?>
				</div>
				<div class="listedvideolistfootdivoc">
					<?php echo JText::_('Added Date');?>: <?php echo $catvideo->addeddate;?>   - <?php echo JText::_('Duration');?>: <?php echo $catvideo->duration;?>
				</div>
				
			</div>
			
			<div class="listedvideolistthumbdivoc">
				<a href="<?php echo $catvideo->videolink;?>">
					<img class="listedvideolistthumbnailoc" src="<?php echo $catvideo->videothumbnail;?>" alt=""/> 
				</a>
				<div id="uvaddtoqlbdiv<?php echo $catvideo->id; ?>" style="margin-top:-22px; padding-left:5px; z-index:9999;">

					<img id="uvaddtoqlimg_js_<?php echo $catvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $catvideo->id; ?>', '<?php echo htmlentities($catvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $catvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
					<img id="uvaddtoqlimg_js_rem<?php echo $catvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

				</div>						
			</div>

			<div class="listedvideolistextrasdivoc">

					
					<?php echo $catvideo->useravatar; ?><br/>
					<?php echo $catvideo->usernamelinked; ?>
					<div style="">
						<?php echo $catvideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<?php echo JText::_('Views');?> : <?php echo $catvideo->hits; ?>
											
					
				
			</div>					

			
			<div class="clear"></div>
		</div>



		<?php	

		
		}
				
	} else {

		foreach ($this->videoListInCat as $catvideo) {
		
			$safevideotitle = str_replace("'", "\'", $catvideo->videotitle);
			$safevideotitle = str_replace("\"", "&quot;", $safevideotitle);				
		
			$inql = false;
			if (in_array($catvideo->id, $this->quicklistarray)) {
				$inql = true;			
			}

		?>
		
		<div class="listedvideolistvideomc">
			<div class="backgroundpadding">
				<div class="listedvideolisttitledivmc">
					<a href="<?php echo $catvideo->videolink;?>" style="font-weight:bold;">
						<?php echo $catvideo->videotitle;?>
					</a>
				</div>
			</div>
			
			<div class="backgroundpadding">
				<div class="listedvideolistbodymc">
					<div class="listedvideolistthumbdivmc">
						<a href="<?php echo $catvideo->videolink;?>">
							<img class="listedvideolistthumbnailmc" src="<?php echo $catvideo->videothumbnail;?>" alt=""/> 
						</a>
						<div id="uvaddtoqlbdiv<?php echo $catvideo->id; ?>" class="videolistqlbtnmc">

							<img id="uvaddtoqlimg_js_<?php echo $catvideo->id; ?>" class="addtoquicklistbutton" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/add_ql.png";?>" alt="" onclick="jQuery.seyrettools.addtoquicklist('<?php echo $catvideo->id; ?>', '<?php echo htmlentities($catvideo->videothumbnail);?>', '<?php echo $safevideotitle; ?>', '<?php echo $catvideo->videonojxlink; ?>')" style="visibility:<?php echo ($inql==false)? 'visible' : 'hidden';?>;"/>
							<img id="uvaddtoqlimg_js_rem<?php echo $catvideo->id; ?>" src="<?php echo JURI::root()."components/com_seyret/themes/default/images/added_ql.png";?>" alt="" style="visibility:<?php echo $inql==false ? 'hidden' : 'visible';?>; margin-left:-16px;"/>

						</div>	

						<div class="listedvideolistdurationdivmc"><?php echo $catvideo->duration;?>
						</div>
						
					</div>
					<div style="clear:both;"></div>
					<div class="listedvideolistvotestarsmc">
						<?php echo $catvideo->votestars; ?>
						<div class="clear"></div>
					</div>
					
					<div class="listedvideousernamemc">
						<?php echo $catvideo->usernamelinked; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo $catvideo->addeddate; ?>
					</div>
					
					<div class="clear"></div>

					<div class="listedvideousernamemc">
						<?php echo JText::_('Views');?>: <?php echo $catvideo->hits; ?>
					</div>
					
					<div class="listedvideoaddeddatemc">
						<?php echo JText::_('Comments');?>: <?php echo $catvideo->commentcount; ?>
					</div>
					
					<div class="clear"></div>

					
				</div>
			</div>
		</div>
		


		<?php	

		
		}			
	
	
	}
	
	
	?>
	
	<div class="clear"></div>
	<div class="paginatordiv">
	
		<?php echo $this->cvlpageNav; ?>
	
	</div>		
				
	<div style="clear:both;"></div>	

</div>